import 'package:flutter/material.dart';
import 'package:flutter_camera2/global.dart';
import 'package:get/get.dart';
import 'camera4.dart';
import 'camera3.dart';
import 'camera5.dart';
import 'camera6.dart';
import 'futureloop1.dart';

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('主页'),
        ),
        body: Column(
          children: [
            //1.按钮
            ElevatedButton(
              onPressed: (){
                //命名路由写法
                Get.to(()=>TakePictureScreen(camera: Global.cameras[0]));
              },
              child: Text('拍照1'),
            ),
            ElevatedButton(
              onPressed: (){
                //命名路由写法
                Get.to(()=>MyHomePage3(title: '拍照',));
              },
              child: Text('拍照3'),
            ),
            ElevatedButton(
              onPressed: (){
                //命名路由写法
                Get.to(()=>TakePictureScreen2(camera: Global.cameras[0]));
              },
              child: Text('camera5'),
            ),
            ElevatedButton(
              onPressed: (){
                //命名路由写法
                Get.to(()=>FutureLoopPage1());
              },
              child: Text('倒计时1'),
            ),
            ElevatedButton(
              onPressed: (){
                //命名路由写法
                Get.to(()=>TakePictureScreen3(camera: Global.cameras[1]));
              },
              child: Text('camera6'),
            ),

          ],
        )
    );
  }
}